using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkDiagramTools._Configuration
{
    /// <summary>
    /// <para>Add Relative Mainline Layout</para>
    /// <para>Adds the Relative Mainline Layout algorithm to the list of layouts to be automatically chained at the end of the building of diagrams based on a given template. This tool also presets the Relative Mainline Layout algorithm parameters for any diagram based on that template.</para>
    /// <para>将“相对主线布局”算法添加到布局列表中，以便在基于给定模板构建逻辑示意图结束时自动链接。此工具还会为基于该模板的任何逻辑示意图预设相对主线布局算法参数。</para>
    /// </summary>    
    [DisplayName("Add Relative Mainline Layout")]
    public class AddRelativeMainlineLayout : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddRelativeMainlineLayout()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// </param>
        /// <param name="_template_name">
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// </param>
        /// <param name="_is_active">
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the layout algorithm will automatically execute when generating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added layout algorithm will automatically run during the generation of any diagram that is based on the Input Diagram Template parameter. This is the default.
        ///       <para>The parameter values specified for the layout algorithm are used to run the layout during diagram generation. They are also loaded by default when the algorithm is to be run on any diagram based on the input template.    </para>
        ///     </bullet_item><para/>
        ///     <bullet_item>Unchecked—All the parameter values currently specified for the added layout algorithm will be loaded by default when the algorithm is to be run on any diagram based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成逻辑示意图时是否自动执行布局算法。
        ///   <bulletList>
        /// <bullet_item>选中 - 添加的布局算法将在生成基于输入逻辑示意图模板参数的任何逻辑示意图期间自动运行。这是默认设置。
        ///       <para>为布局算法指定的参数值用于在逻辑示意图生成期间运行布局。默认情况下，当算法要在基于输入模板的任何逻辑示意图上运行时，也会加载它们。   </para>
        ///     </bullet_item><para/>
        ///     <bullet_item>未选中—默认情况下，当要在基于输入模板的任何逻辑示意图上运行该算法时，将加载当前为添加的布局算法指定的所有参数值。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_line_attribute">
        /// <para>Line Attribute</para>
        /// <para>The name of the network attribute that will be used to identify the lines that comprise the straight lines. This network attribute must exist in the network line classes. Its values must be the same for all the edges that comprise a straight line, for example, Line 1, Line 2, and so on.</para>
        /// <para>将用于标识组成直线的线的网络属性的名称。此网络属性必须存在于网络线路类中。对于构成直线的所有边，其值必须相同，例如，线 1、线 2 等。</para>
        /// </param>
        public AddRelativeMainlineLayout(object _in_utility_network, object _template_name, _is_active_value _is_active, object _line_attribute)
        {
            this._in_utility_network = _in_utility_network;
            this._template_name = _template_name;
            this._is_active = _is_active;
            this._line_attribute = _line_attribute;
        }
        public override string ToolboxName => "Network Diagram Tools";

        public override string ToolName => "Add Relative Mainline Layout";

        public override string CallName => "nd.AddRelativeMainlineLayout";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_utility_network, _template_name, _is_active.GetGPValue(), _line_attribute, _mainline_direction.GetGPValue(), _offset_between_branches, _breakpoint_angle, _type_attribute, _mainline_values, _branch_values, _excluded_values, _is_compressing.GetGPValue(), _compression_ratio, _minimal_distance, _alignment_attribute, _initial_distances.GetGPValue(), _length_attribute, _out_utility_network, _out_template_name];

        /// <summary>
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _template_name { get; set; }


        /// <summary>
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the layout algorithm will automatically execute when generating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added layout algorithm will automatically run during the generation of any diagram that is based on the Input Diagram Template parameter. This is the default.
        ///       <para>The parameter values specified for the layout algorithm are used to run the layout during diagram generation. They are also loaded by default when the algorithm is to be run on any diagram based on the input template.    </para>
        ///     </bullet_item><para/>
        ///     <bullet_item>Unchecked—All the parameter values currently specified for the added layout algorithm will be loaded by default when the algorithm is to be run on any diagram based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成逻辑示意图时是否自动执行布局算法。
        ///   <bulletList>
        /// <bullet_item>选中 - 添加的布局算法将在生成基于输入逻辑示意图模板参数的任何逻辑示意图期间自动运行。这是默认设置。
        ///       <para>为布局算法指定的参数值用于在逻辑示意图生成期间运行布局。默认情况下，当算法要在基于输入模板的任何逻辑示意图上运行时，也会加载它们。   </para>
        ///     </bullet_item><para/>
        ///     <bullet_item>未选中—默认情况下，当要在基于输入模板的任何逻辑示意图上运行该算法时，将加载当前为添加的布局算法指定的所有参数值。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Active")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _is_active_value _is_active { get; set; }

        public enum _is_active_value
        {
            /// <summary>
            /// <para>ACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ACTIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INACTIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Line Attribute</para>
        /// <para>The name of the network attribute that will be used to identify the lines that comprise the straight lines. This network attribute must exist in the network line classes. Its values must be the same for all the edges that comprise a straight line, for example, Line 1, Line 2, and so on.</para>
        /// <para>将用于标识组成直线的线的网络属性的名称。此网络属性必须存在于网络线路类中。对于构成直线的所有边，其值必须相同，例如，线 1、线 2 等。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _line_attribute { get; set; }


        /// <summary>
        /// <para>Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction of the main line.</para>
        ///   <bulletList>
        ///     <bullet_item>From left to right—The main line will be drawn as a horizontal line starting from the left and ending on the right. This is the default.</bullet_item><para/>
        ///     <bullet_item>From top to bottom—The main line will be drawn as a vertical line starting from the top and ending at the bottom.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定主线的方向。</para>
        ///   <bulletList>
        ///     <bullet_item>从左到右—主线将绘制为一条水平线，从左开始，到右侧结束。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>从上到下 - 主线将绘制为从顶部开始到底部结束的垂直线。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _mainline_direction_value _mainline_direction { get; set; } = _mainline_direction_value._FROM_LEFT_TO_RIGHT;

        public enum _mainline_direction_value
        {
            /// <summary>
            /// <para>From left to right</para>
            /// <para>From left to right—The main line will be drawn as a horizontal line starting from the left and ending on the right. This is the default.</para>
            /// <para>从左到右—主线将绘制为一条水平线，从左开始，到右侧结束。这是默认设置。</para>
            /// </summary>
            [Description("From left to right")]
            [GPEnumValue("FROM_LEFT_TO_RIGHT")]
            _FROM_LEFT_TO_RIGHT,

            /// <summary>
            /// <para>From top to bottom</para>
            /// <para>From top to bottom—The main line will be drawn as a vertical line starting from the top and ending at the bottom.</para>
            /// <para>从上到下 - 主线将绘制为从顶部开始到底部结束的垂直线。</para>
            /// </summary>
            [Description("From top to bottom")]
            [GPEnumValue("FROM_TOP_TO_BOTTOM")]
            _FROM_TOP_TO_BOTTOM,

        }

        /// <summary>
        /// <para>Offset Between Branches</para>
        /// <para>The spacing between two adjacent branches along the axis perpendicular to the direction of the lines.</para>
        /// <para>沿垂直于线方向的轴的两个相邻分支之间的间距。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Offset Between Branches")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _offset_between_branches { get; set; } = "2 Unknown";


        /// <summary>
        /// <para>Break Point Angle (in degrees)</para>
        /// <para>The angle that will be used to position the break point on the branches. It is a value between 30 and 90 degrees that is combined with the Offset Between Branches parameter value to compute this position. When the break point angle value is 90 degrees, each branch displays orthogonally.</para>
        /// <para>将用于在分支上定位断点的角度。它是介于 30 度和 90 度之间的值，与“分支之间的偏移”参数值相结合以计算此位置。当断点角度值为 90 度时，每个分支都正交显示。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Break Point Angle (in degrees)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _breakpoint_angle { get; set; } = 45;


        /// <summary>
        /// <para>Type Attribute</para>
        /// <para><xdoc>
        ///   <para>The name of the network attribute that will be used to qualify the lines. This network attribute may exist in the network line classes.</para>
        ///   <para>The Type Attribute and Line Attribute parameter values can be the same.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于限定行的网络属性的名称。此网络属性可能存在于网络线路类中。</para>
        ///   <para>Type Attribute 和 Line Attribute 参数值可以相同。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Type Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _type_attribute { get; set; } = null;


        /// <summary>
        /// <para>Mainline Values</para>
        /// <para>The Type Attribute values that identify the main lines. When such values exist, they must be the same for any edge that comprises the main lines, regardless of their related network feature line classes or edge object tables.</para>
        /// <para>用于标识主线的 Type 属性值。如果存在此类值，则对于包含主线的任何边，无论其相关的网络要素线类或边对象表如何，这些值都必须相同。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Mainline Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _mainline_values { get; set; } = null;


        /// <summary>
        /// <para>Branch Values</para>
        /// <para>The Type Attribute values that identify the branches.</para>
        /// <para>用于标识分支的 Type 属性值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Branch Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _branch_values { get; set; } = null;


        /// <summary>
        /// <para>Excluded Values</para>
        /// <para>The Type Attribute values that identify the edges that will be excluded from the straight lines (crossovers or ladders).</para>
        /// <para>Type 属性值，用于标识将从直线（交叉线或梯形图）中排除的边。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Excluded Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _excluded_values { get; set; } = null;


        /// <summary>
        /// <para>Compression along the direction</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the graph will be compressed.
        ///   <bulletList>
        ///     <bullet_item>Checked—Compression will be used. An additional step is executed at the end of the process to reduce the distances between adjacent groups of neighbor junctions along the direction while maintaining relative positioning between these groups. Neighbor junctions are junctions that are geographically close to each other without being directly connected.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Compression will not be used. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否压缩图形。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将使用压缩。在过程结束时执行一个附加步骤，以减少沿方向的相邻邻结组之间的距离，同时保持这些组之间的相对位置。相邻交汇点是指在地理上彼此靠近但不直接连接的交汇点。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 不使用压缩。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression along the direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_compressing_value _is_compressing { get; set; } = _is_compressing_value._false;

        public enum _is_compressing_value
        {
            /// <summary>
            /// <para>USE_COMPRESSION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_COMPRESSION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_USE_COMPRESSION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_USE_COMPRESSION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Ratio (%)</para>
        /// <para>A value between 0 and 100 that is applied to the length of any edge after subtracting the minimal distance of its length. When Ratio (%) is 100, the distance between each detected junction group is equal to the minimal distance.</para>
        /// <para>一个介于 0 和 100 之间的值，在减去任何边的最小长度距离后应用于任何边的长度。当比率 （%） 为 100 时，每个检测到的结点组之间的距离等于最小距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ratio (%)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _compression_ratio { get; set; } = 0;


        /// <summary>
        /// <para>Minimal Distance</para>
        /// <para>The minimal distance between two adjacent groups of neighbor junctions. This minimal distance is also used to group neighbor junctions based on their projection along the direction axis. Two junctions projected on this axis will belong to the same group when the distance between the two projected points is less than this distance.</para>
        /// <para>相邻的两组相邻交汇点之间的最小距离。此最小距离还用于根据相邻交汇点沿方向轴的投影对相邻交汇点进行分组。当两个投影点之间的距离小于此距离时，在此轴上投影的两个交汇点将属于同一组。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimal Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _minimal_distance { get; set; } = "0 Unknown";


        /// <summary>
        /// <para>Alignment Attribute</para>
        /// <para>The name of the network attribute that will be used to align lines that are split. The algorithm aligns lines with the same attribute value.</para>
        /// <para>将用于对齐要拆分的线的网络属性的名称。该算法使用相同的属性值对齐线。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Alignment Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _alignment_attribute { get; set; } = null;


        /// <summary>
        /// <para>Initial Distances</para>
        /// <para><xdoc>
        ///   <para>Specifies how the length of the diagram edges will be assessed. This length determines the positions of the junctions along the direction. The distances between the connected junctions along the direction are not equidistant; they are relative to each other and depend on the current edge length and the length of the shortest edge.</para>
        ///   <bulletList>
        ///     <bullet_item>From current edge geometry— The distances will be computed from the current edge geometry. This is the default.</bullet_item><para/>
        ///     <bullet_item>From attribute edge—The distances will be computed from a given attribute that exists on an edge.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何评估关系图边的长度。该长度决定了沿方向的交汇点的位置。沿方向连接的交汇点之间的距离不是等距的;它们彼此相对，取决于当前边的长度和最短边的长度。</para>
        ///   <bulletList>
        ///     <bullet_item>从当前边几何 - 距离将从当前边几何计算。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>从属性边 - 将根据边上存在的给定属性计算距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Initial Distances")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _initial_distances_value _initial_distances { get; set; } = _initial_distances_value._FROM_CURRENT_EDGE_GEOMETRY;

        public enum _initial_distances_value
        {
            /// <summary>
            /// <para>From current edge geometry</para>
            /// <para>From current edge geometry— The distances will be computed from the current edge geometry. This is the default.</para>
            /// <para>从当前边几何 - 距离将从当前边几何计算。这是默认设置。</para>
            /// </summary>
            [Description("From current edge geometry")]
            [GPEnumValue("FROM_CURRENT_EDGE_GEOMETRY")]
            _FROM_CURRENT_EDGE_GEOMETRY,

            /// <summary>
            /// <para>From attribute edge</para>
            /// <para>From attribute edge—The distances will be computed from a given attribute that exists on an edge.</para>
            /// <para>从属性边 - 将根据边上存在的给定属性计算距离。</para>
            /// </summary>
            [Description("From attribute edge")]
            [GPEnumValue("FROM_ATTRIBUTE_EDGE")]
            _FROM_ATTRIBUTE_EDGE,

        }

        /// <summary>
        /// <para>Length Attribute</para>
        /// <para>The network attribute from which the distances will be computed when Initial Distances is From attribute edge.</para>
        /// <para>当“初始距离”为“从”属性边时，将从中计算距离的网络属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Length Attribute")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _length_attribute { get; set; } = null;


        /// <summary>
        /// <para>Output Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_utility_network { get; set; }


        /// <summary>
        /// <para>Output Diagram Template</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_template_name { get; set; }


        public AddRelativeMainlineLayout SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}